﻿<UserControl x:Class="XbdSoft.WPFVersion.UserControls.WaitingUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid x:Name="LayoutRoot" Width="Auto" Height="Auto">
        <Grid Background="Black" Opacity="0.2"></Grid>
        <Canvas Width="320" Height="50">
            <Rectangle RadiusX="8" RadiusY="8" Stroke="{x:Null}" Fill="#19000000" Height="49" Width="316" Canvas.Left="6" Canvas.Top="3"/>
            <Rectangle RadiusX="8" RadiusY="8" Stroke="{x:Null}" Fill="#19000000" Height="48" Width="316" Canvas.Left="5" Canvas.Top="3"/>
            <Border Height="50" Width="320" Background="#FFFFFFFF" BorderBrush="#FFACACAC" BorderThickness="1,1,1,1" CornerRadius="8,8,8,8">
                <Rectangle RadiusX="8" RadiusY="8" Stroke="{x:Null}" Margin="1,1,1,1">
                    <Rectangle.Fill>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> 
                           <GradientStop Color="#FFFFFFFF"/>
                            <GradientStop Color="#FFE9E9E9" Offset="1"/>
                        </LinearGradientBrush>
                    </Rectangle.Fill>
                </Rectangle>
            </Border>
        </Canvas>
        <Grid Width="320" Height="52" VerticalAlignment="Center" Margin="0,125,-20,123">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="16*" />
                <ColumnDefinition Width="99*" />
                <ColumnDefinition Width="114*" />
                <ColumnDefinition Width="91*" />
            </Grid.ColumnDefinitions>
            <!--waiting.png自己可以找一个图片-->
            <Image Stretch="None" Source="Images/waiting.gif" Grid.Column="1" Opacity="0.3" />
            <Image x:Name="WaitingImage" Stretch="None" Source="Images/waiting.gif" Grid.Column="1" RenderTransformOrigin="0.5,0.5">
                <Image.RenderTransform>
                    <RotateTransform Angle="0"></RotateTransform>
                </Image.RenderTransform>
            </Image>
            <TextBlock Name="titleText" FontFamily="Calibri" FontSize="13" Foreground="#FF000000" HorizontalAlignment="Left" Grid.Column="3"/>
            <TextBlock Text="Waiting..." x:Name="waitingText" 
       FontFamily="Verdana" FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="2"/>
        </Grid>
    </Grid>
    <UserControl.Resources> 
        <Storyboard x:Key="storyboard" >
            <DoubleAnimation Storyboard.TargetName="WaitingImage"  Duration="0:0:0.7" To="360" Storyboard.TargetProperty="(UIElement.RenderTransform).RotateTransform.Angle" RepeatBehavior="Forever"></DoubleAnimation>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="waitingText" Storyboard.TargetProperty="Opacity" RepeatBehavior="Forever">
                <SplineDoubleKeyFrame KeyTime="00:00:0.0" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:0.5" Value="1"/>
                <SplineDoubleKeyFrame KeyTime="00:00:1.0" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </UserControl.Resources>
</UserControl>
